package ch02;
import java.util.Scanner;

public class TestMain_241 {
    /**
     * 输出 print  println  printf
     * @param args
     */
    public static  void  main (String[] args){
        System.out.print("A,");
        System.out.print("B,");
        System.out.print("C,");
        System.out.println();
        System.out.println("END");

//      格式化输出
        double d = 12900000;
        System.out.println(d);

        double d1 = 3.1415926;
        System.out.printf("%.2f%%\n",d1);

        /**
         * 输入
         */
        Scanner scanner = new Scanner(System.in); // 创建Scanner对象
        System.out.print("Input your name: "); // 打印提示
        String name = scanner.nextLine(); // 读取一行输入并获取字符串
        System.out.print("Input your age: "); // 打印提示
        int age = scanner.nextInt(); // 读取一行输入并获取整数
        System.out.printf("Hi, %s, you are %d\n", name, age); // 格式化输出


    }

}
